import 'package:flutter/material.dart';

class Box1 extends StatefulWidget {
  Box1({Key? key}) : super(key: key);

  @override
  State<Box1> createState() => _Box1State();
}

class _Box1State extends State<Box1> {
  bool _active = false;
  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: () {
        setState(() {
          _active = !_active;
        });
      },
      child: Container(
        child: Center(
          child: Text(
            _active ? 'Active' : 'Not Active',
            style: TextStyle(
              fontSize: 32,
              color: Colors.white,
            ),
          ),
        ),
        decoration: BoxDecoration(color: _active ? Colors.green : Colors.grey),
      ),
    );
  }
}
